package com.examplemartin.jpademo.dao;

import com.examplemartin.jpademo.pojo.po.purchase.PurPO;
import com.examplemartin.jpademo.pojo.po.repository.purchase.PurInPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface PurInDao extends JpaRepository<PurInPO,Long>, JpaSpecificationExecutor<PurInPO> {

//    @Query("from com.examplemartin.jpademo.pojo.po.repository.purchase.PurInPO as t1 ")
    @Query("from t_purin t1 where t1.purPO.id = :id ")
    List<Object> sumInStock(Long id);

    // 查询已入库明细数量 -- 采购单id
    List<PurInPO> findAllByPurPOAndStatus(PurPO purpo,Integer purinstatus);


}
